package com.zmzncs.lmtc.module.park.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmzncs.lmtc.common.pojo.ChnnelsBody;
import com.zmzncs.lmtc.common.pojo.LoginUser;
import com.zmzncs.lmtc.common.pojo.daoer.GateOnOff;
import com.zmzncs.lmtc.common.util.JwtUtil;
import com.zmzncs.lmtc.module.park.dao.ParkInfoDao;
import com.zmzncs.lmtc.module.park.pojo.park_info.ParkInfo;
import com.zmzncs.lmtc.module.park.pojo.park_info.ParkManagerParkInfoDTO;
import com.zmzncs.lmtc.module.park.pojo.park_manager.ParkInfoSpaceForm;
import com.zmzncs.lmtc.module.park.service.ParkInfoDaoerService;
import com.zmzncs.lmtc.module.park.service.ParkInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 任建波
 * @since 2020-09-29
 */
@Slf4j
@Service
public class ParkInfoServiceImpl extends ServiceImpl<ParkInfoDao, ParkInfo> implements ParkInfoService {

    @Autowired
    ParkInfoDao parkInfoDao;
    @Autowired
    ParkInfoDaoerService parkInfoDaoerService;




    @Autowired
    HttpServletRequest request;
    /**
     * 修改车场车位数
     *
     * @param form
     */
    @Override
    public int updateParkInfoSpaceForm(ParkInfoSpaceForm form) {
        return  parkInfoDao.updateParkInfoSpaceForm(form);
    }

    @Override
    public List<ParkManagerParkInfoDTO> getParkManageParkInfoByManageId() {
        LoginUser loginUser = JwtUtil.getLoginUser(request);
        return parkInfoDao.getParkManageParkInfoByManageId(loginUser.getCustomerId());
    }

}
